package com.best.oasis.settlement.common.configmapping;

import java.util.HashMap;
import java.util.Map;

import com.best.oasis.settlement.common.entity.employee.Employee;

/**
 * entity的code配置 
 * 
 * @author bl00252
 */
public class EntityCodePrefixMapping {
	
	public static final CodeConfig DEFAULT_CONFIG = new CodeConfig("","yyMMdd",8);
	
	//public static final Map<Class<?>, CodeConfig> MAP = new HashMap<Class<?>, CodeConfig>();
	public static final Map<String, CodeConfig> MAP = new HashMap<String, CodeConfig>();
	static{
		MAP.put( "Sample" , new CodeConfig("S","yyMMdd",6));
		//Employee
		MAP.put( "Employee" , new CodeConfig("BL",null,5));
		//Site
		MAP.put( "Site" , new CodeConfig("T",null,6));
		//Department
		MAP.put( "Department" , new CodeConfig("",null,2));
	}
	
	
	public static class CodeConfig{
		// code前缀
		private String prefix;
		// 日期格式
		private String dateFormat;
		//流水号中数字的长度
		private int numberLength;
		
		public CodeConfig(String prefix, String dateFormat, int numberLength) {
			this.prefix = prefix;
			this.dateFormat = dateFormat;
			this.numberLength = numberLength;
		}
		public String getPrefix() {
			return prefix;
		}
		public String getDateFormat() {
			return dateFormat;
		}
		public int getNumberLength() {
			return numberLength;
		}
	}
}
